<!DOCTYPE HTML>
<html>
<head>
<!-- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -->
<meta charset="UTF-8" />
<meta http-equiv="MSThemeCompatible" content="Yes" />
<meta name="keywords" content="Emarbox,DSP,Demand-Side Platform Provider" />
<meta name="description" content="Emarbox,DSP,Demand-Side Platform Provider" />
<meta name="generator" content="Emarbox DSP 1.0" />
<meta name="author" content="Emarbox R&amp;D Team and Emarbox UI Team" />
<meta name="copyright" content="2012 Emar Inc." />
<meta name="version" content="[ Int1024 ]" />
<title>SEMWinner - Emarbox</title>
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico?t=1362103943270"/>
<link rel="stylesheet" type="text/css" href="../theme/style.css?t=1362103943270" />
<script type="text/javascript" src="../js/jquery/jquery.js?v=1.7.2&t=1362103943270"></script>
<script type="text/javascript" src="../js/app_prototype.js?t=1362103943270"></script>


<script type="text/javascript">
<!--//-->//><!--

//应用全局变量
var app = {};
app.path    = '/semwinner3';
app.base    = 'http://localhost:8080/semwinner3';
app.timestamp = '1362103943270';
app.version    = '[ Int1024 ]';
app.log_enabled = 'yes';
app.success = '1';
app.failed  = '0';
app.project_id='1979';


//--><!
</script>


<script type="text/javascript" src="../js/jquery/jquery.hash.js?v=1.7.2&t=1362103943270"></script>
<script type="text/javascript" src="../js/app_common.js?t=1362103943270"></script>


<link type="text/css" href="../js/jquery-ui/css/smoothness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-ui/js/jquery-ui-1.8.20.custom.min.js"></script>


</head>
<body>

<link href="../js/jquery/daterangepicker/css/ui.daterangepicker.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery/daterangepicker/js/daterangepicker.jQuery.js"></script>
<script type="text/javascript" src="../js/jquery/daterangepicker/js/ui.datepicker-zh-CN.js"></script>




<script type="text/javascript">
<!--//--><![CDATA[//><!--
$(function(){

// 1 起始日期不能大于结束日期
// 2 超过日期跨度提示，并不修改原始值



var d1 = $("#first_state_time,#first_end_time");

	d1.daterangepicker({
		arrows : true,
		datepickerOptions : {
			changeMonth : true,
			changeYear : true,
			minDate : Date.parse('2012-08-01'),
			maxDate : Date.parse('yesterday'),
			onChange : function() {
			   
				var dateA = Date.parse($("#first_state_time").val());
				var dateB = Date.parse($("#first_end_time").val());
				if(dateA > dateB){
					alert("开始日期不能大于结束日期。");
					return;
				}

				var isOutOfMonth = false;
				if( dateA.getFullYear() == dateB.getFullYear() ){
				
					isOutOfMonth = (dateB.getMonth() - dateA.getMonth() > 2 ) ? true : false;

				}else{
					isOutOfMonth = ( (dateB.getMonth()+12) - dateA.getMonth() > 2 ) ? true : false;
				
				}

				if(isOutOfMonth){

					alert("查询时间跨度需在3个自然月内。");

					$("#first_state_time").val(Date.parse('yesterday'));
					$("#first_end_time").val(Date.parse('yesterday'));

					return;
				}
				
			},
		},
		presets:{
			dateRange:'自定义时间段'
		}
		
	});


});

//--><!]]>
</script>


<br /><br /><br />
<p>
	<input type="text" class="w_h w_h_d"  readonly="readonly" name="paqing.stateTime" id="first_state_time" value="" />
	至&nbsp;&nbsp;
	<input type="text" class="w_h w_h_d"  readonly="readonly" name="paqing.endTime" id="first_end_time" value="" />

	<input id="query" class="but_x_l" type="button" value="查询" />
</p>





</body>
</html>
